package Servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import Info.AdminInfo;
import Info.CustomerInfo;
import Manage.AdminManage;
import Manage.CustomerManage;

public class UpdateCustomerS extends HttpServlet {
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		response.setContentType("text/html;charset=utf-8");
		request.setCharacterEncoding("utf-8");
		
		int cid=Integer.parseInt(request.getParameter("cid"));
		String name=request.getParameter("name");
		String sex=request.getParameter("sex");
		String age=request.getParameter("age");
		String nationality=request.getParameter("nationality");
		String card=request.getParameter("card");
		String phone=request.getParameter("phone");
		String roomId=request.getParameter("roomId");
		String intoTime=request.getParameter("intoTime");
		String outTime=request.getParameter("outTime");
		
		
		CustomerManage customerm=new CustomerManage();
		CustomerInfo customer=new CustomerInfo(cid, name, sex, age, nationality, card, phone, roomId, intoTime, outTime);
			customerm.update(customer);
			request.getRequestDispatcher("LookCustomerServlet").forward(request, response);
	  }
}
